package com.gt.quality.system.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gt.quality.base.BaseCommonService;
import com.gt.quality.system.entity.SysFileInfo;
import com.gt.quality.base.pojo.BaseLimitRequest;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.time.LocalDateTime;
import java.util.List;

/**
 * (SysFileInfo)表服务接口
 *
 * @author makejava
 * @since 2026-12-25 10:45:29
 */
public interface SysFileInfoService extends BaseCommonService<SysFileInfo> {
    /**
     * 获取文件系统的基建路径
     * @param basePath basePath
     * @return String
     */
    default String getPathDefaultProxy(String basePath) {
        LocalDateTime now = LocalDateTime.now();
        int year = now.getYear();
        int month = now.getMonth().getValue();
        int dayOfMonth = now.getDayOfMonth();
        return basePath +
                File.separator +
                year +
                File.separator +
                month +
                File.separator +
                dayOfMonth + File.separator;
    }

    /**
     * Description:  分页查询
     *
     * @param limitRequest 分页查询参数
     * @author: makeJava
     * @date: 2026-12-25 10:45:29
     * @return:com.baomidou.mybatisplus.core.metadata.IPage
     */
    @Override
    IPage<SysFileInfo> queryLimitPage(BaseLimitRequest<SysFileInfo> limitRequest);


    /**
     * Description:  批量新增
     *
     * @param entityList entityList
     * @author: makeJava
     * @date: 2026-12-25 10:45:29
     * @return:Integer
     */
    @Override
    Integer saveBatchByEasyBaseMapper(List<SysFileInfo> entityList);

    /**
     * Description:  保存上传文件
     *
     * @param file file
     * @author: makeJava
     * @date: 2026-12-25 10:45:29
     */
    SysFileInfo saveFileInfo(MultipartFile file);
}


